package main

import "fmt"

func solution(n int, u []int) int {
	if n != len(u) {
		panic("n must equal to length of u")
	}

	min := u[0]
	for _, num := range u {
		if num < min {
			min = num
		}
	}

	count := 0
	for _, num := range u {
		if num == min {
			count++
		}
	}

	return n - count
}

func main() {
	fmt.Println(solution(5, []int{1, 2, 3, 1, 2}) == 3)
	fmt.Println(solution(4, []int{100000, 100000, 100000, 100000}) == 0)
	fmt.Println(solution(6, []int{1, 1, 1, 2, 2, 2}) == 3)
}
